Component({
    properties: {
        data: Object,
    },
    data: {
        tags: Array
    },
    observers: {
        data: function (data) {
            if (!data) {
                return
            }
            if (!data.tags) {
                return
            }
            const tags = data.tags.split('$')
            this.setData({
                tags
            })
        }
    },
    methods: {
        onItemTab(event) {
            // 拿到自定义标签的值
            const pid = event.currentTarget.dataset.pid
            // 跳转页面
            wx.navigateTo({
                url: `/pages/detail/index?pid=${pid}`
            })
        }
    }
});
